/*
  学习目标：React创建元素练习
*/

import React from 'react';
import ReactDOM from 'react-dom';

// 💥 class要写成className
const divNode = React.createElement(
  'div',
  { id: 'box', className: 'demo' },
  'hello React'
);

const liNode1 = React.createElement('li', null, '香蕉1');
const liNode2 = React.createElement('li', null, '香蕉2');
const liNode3 = React.createElement('li', null, '香蕉3');

// 💥 React不解析html字符串
const ulNode = React.createElement(
  'ul',
  { className: 'list' },
  liNode1,
  liNode2,
  liNode3
);

// 💥 ReactDOM.render全局只调用一次
// ReactDOM.render(divNode, document.getElementById('root'));
ReactDOM.render(ulNode, document.getElementById('root'));
